package getData;

public class MyURL {
	private String begin;//http://stock.liangyee.com/bus-api/stock/freeStockMarketData/getDailyKBar
	private String userKey;//?userKey=1D0CDB819CD44479BA24B0A9AFB8D74D
	private String startDate;//&startDate=2016-01-01
	private String stockCode;//&symbol=600300
	private String endDate;//&endDate=2016-02-20
	private String market;//&type=0
	private String url;
	MyURL(String year,String code){
		setBegin("http://stock.liangyee.com/bus-api/stock/freeStockMarketData/getDailyKBar");
		setUserKey("?userKey=1D0CDB819CD44479BA24B0A9AFB8D74D");
		setStartDate("&startDate="+year+"-01-01");
		setStockCode("&symbol="+code);
		setEndDate("&endDate="+year+"-12-31");
		setMarket("&type=0");
		url = begin+userKey+startDate+stockCode+endDate+market;

	}
	public void setBegin(String newS) {
		begin = newS;
	}
	public void setUserKey(String newS) {
		userKey = newS;
	}
	public void setStartDate(String newS) {
		startDate = newS;
	}
	public void setStockCode(String newS) {
		stockCode = newS;
	}
	public void setEndDate(String newS) {
		endDate = newS;
	}
	public void setMarket(String newS) {
		market = newS;
	}
//------------------------------SET------------------------------------------------
	public String getBegin() {
		return begin;
	}
	public String getUserKey() {
		return userKey;
	}
	public String getStartDate() {
		return startDate;
	}
	public String getStockCode() {
		return stockCode;
	}
	public String getEndDaten() {
		return endDate;
	}
	public String getMarket() {
		return market;
	}
	public String getURL() {
		return url;
	}
//------------------------------GET------------------------------------------------

}
